<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/jquery-1.11.3.min.js"></script>
    <script>
        function req() {
            //发请求

            //let params="username=小明&password=123&email=123@qq.com";
            //并不是所有人 发参数 都写 key=value&key=value的方式!!
            let params={
                username:"小明",
                password:"123",
                email:"123@qq.com"
            }

            let s=JSON.stringify(params);

            $.ajax({
                url:"/ret/foo7",
                data:s,
                type:"post",
                processData:false, //用jquery给后端发请求  但是不需要画蛇添足
                contentType:"application/json",
                success:function(data){
                    console.log(data);
                }


            })

        }

    </script>

</head>
<body>
    <input type="button" value="点我发请求" onclick="req()">
</body>
</html>